﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FEM.Result;

namespace PBSD_Development
{
    /// <summary>
    /// 工况信息
    /// </summary>
    public class LoadCaseObj
    {
        /// <summary>
        /// 工况对象
        /// </summary>
        private LoadCase loadCaseObj { set; get; }

        /// <summary>
        /// 工况名称
        /// </summary>
        public string Name
        {
            get
            {
                return this.loadCaseObj.Name;
            }
        }

        /// <summary>
        /// 获得楼层响应
        /// </summary>
        /// <param name="loadCase"></param>
        /// <param name="reaction"></param>
        /// <returns></returns>
        public double GetMaxReaction(TowerObj tower, StoreyReaction reaction)
        {
            return tower.GetMaxReaction(this, reaction);
        }

        /// <summary>
        /// 获得楼层响应
        /// </summary>
        /// <param name="loadCase"></param>
        /// <param name="reaction"></param>
        /// <returns></returns>
        public double GetMaxReaction(TowerObj tower, StoreyReaction reaction, bool isX)
        {
            return tower.GetMaxReaction(this, reaction, isX);
        }

        /// <summary>
        /// 塔楼最大层间位移角所在楼层
        /// </summary>
        /// <param name="tower"> 塔楼 </param>
        /// <param name="isX"> X向/Y向层间位移角  </param>
        /// <returns> 最大层间位移角所在楼层 </returns>
        public int GetMaxDriftStoreyIndex(TowerObj tower, bool isX)
        {
            return tower.GetMaxDriftStoreyIndex(this, isX);
        }

        /// <summary>
        /// 塔楼最大层间位移角所在楼层
        /// </summary>
        /// <param name="tower"> 塔楼 </param>
        /// <returns> 最大层间位移角所在楼层 </returns>
        public int GetMaxDriftStoreyIndex(TowerObj tower)
        {
            return tower.GetMaxDriftStoreyIndex(this);
        }

        /// <summary>
        /// 塔楼顶部位移
        /// </summary>
        /// <param name="loadCase"></param>
        /// <returns></returns>
        public double GetTopDisp(TowerObj tower)
        {
            return tower.GetTopDisp(this);
        }

        /// <summary>
        /// 塔楼顶部位移
        /// </summary>
        /// <param name="loadCase"></param>
        /// <param name="isX"></param>
        /// <returns></returns>
        public double GetTopDisp(TowerObj tower, bool isX)
        {
            return tower.GetTopDisp(this, isX);
        }

        /// <summary>
        /// 底部楼层剪力
        /// </summary>
        /// <param name="loadCase"></param>
        /// <param name="isX"></param>
        /// <returns></returns>
        public double GetBottomForce(TowerObj tower, bool isX)
        {
            return tower.GetBottomForce(this, isX);
        }

        /// <summary>
        /// 底部倾覆弯矩
        /// </summary>
        /// <param name="loadCase"></param>
        /// <param name="isX"></param>
        /// <returns></returns>
        public double GetBottomMoment(TowerObj tower, bool isX)
        {
            return tower.GetBottomMoment(this, isX);
        }

        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="loadCase_obj"></param>
        public LoadCaseObj(LoadCase loadCase_obj)
        {
            this.loadCaseObj = loadCase_obj;
        }
    }


}
